<template>
  <div>
    <Chart :cdata="cdata" />
  </div>
</template>

<script>
import Chart from './chart.vue';
import { queryThreeCapital } from "../../../../api/index.js";
export default {
  data() {
    return {
      cdata: {
        xData: ["资产", "资源", "资金收入", "资金支出"],
        seriesData: [
          { value: 10, name: "资产" },
          { value: 5, name: "资源" },
          { value: 15, name: "资金收入" },
          { value: 25, name: "资金支出" },
        ]
      }
    }
  },
  components: {
    Chart,
  },
  mounted() {
    this.getData()
  },
  methods: {
    getData() {
      let that = this;
      queryThreeCapital().then(res => {
        let assetNum = res.data.assetNum
        let resourceNum = res.data.resourceNum
        let inputSum = res.data.inputNum
        let outputSum = res.data.outputNum
        that.cdata.seriesData[0].value = assetNum
        that.cdata.seriesData[1].value = resourceNum
        that.cdata.seriesData[2].value = inputSum
        that.cdata.seriesData[3].value = outputSum
      })
    }
  }
}
</script>

<style lang="scss" scoped>
</style>